Skip to content

[WC-3501]: fix(combobox-web): fix inverted editability logic#2332

Merged
r0b1n merged 1 commit into
mainfrom
fix/combobox-editability-inverted
Jul 23, 2026
Merged

[WC-3501]: fix(combobox-web): fix inverted editability logic#2332
r0b1n merged 1 commit into
mainfrom
fix/combobox-editability-inverted

Conversation

@r0b1n

@r0b1n r0b1n commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed a bug in getReadonly() where the conditionally editability mode had inverted logic: expression.value = true (meaning "editable") was being returned directly as the read-only flag, making the widget read-only when it should be editable, and vice versa.
  • Fixed a related bug where the presence of an editable targetAttribute caused the function to return early with false (editable), bypassing the custom editability condition entirely. Now targetAttribute only short-circuits when it is explicitly read-only.
  • Added unit tests covering all branches of getReadonly.

Root cause

Two issues in getReadonly:

  1. The original early-return on targetAttribute presence meant any editable attribute would always report the widget as editable, ignoring the never or conditionally settings.
  2. The conditionally branch returned customEditabilityExpression.value ?? true directly, where the expression represents editability (true = editable), so the boolean was inverted.

@r0b1n
r0b1n requested a review from a team as a code owner July 16, 2026 09:04
@github-actions

This comment has been minimized.

@r0b1n r0b1n changed the title fix(combobox-web): fix inverted editability logic [WC-3501] fix(combobox-web): fix inverted editability logic Jul 16, 2026
@r0b1n r0b1n changed the title [WC-3501] fix(combobox-web): fix inverted editability logic [WC-3501]: fix(combobox-web): fix inverted editability logic Jul 16, 2026
@r0b1n
r0b1n force-pushed the fix/combobox-editability-inverted branch from aecac76 to 2351483 Compare July 16, 2026 13:02
@github-actions

This comment has been minimized.

@r0b1n
r0b1n force-pushed the fix/combobox-editability-inverted branch from 2351483 to 86b58b8 Compare July 17, 2026 10:42
@github-actions

This comment has been minimized.

yordan-st
yordan-st previously approved these changes Jul 17, 2026

@yordan-st yordan-st left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

leonardomendix
leonardomendix previously approved these changes Jul 21, 2026
@r0b1n
r0b1n dismissed stale reviews from leonardomendix and yordan-st via cb1af7a July 23, 2026 09:23
@r0b1n
r0b1n force-pushed the fix/combobox-editability-inverted branch from 86b58b8 to cb1af7a Compare July 23, 2026 09:23
The `conditionally` branch returned `expression.value` directly, so a
truthy value (meaning "editable") made the widget read-only, and vice
versa.  Fixed by returning `true` only when the expression is not `true`,
and added unit tests for all `getReadonly` branches.
@r0b1n
r0b1n force-pushed the fix/combobox-editability-inverted branch from cb1af7a to 4940308 Compare July 23, 2026 13:19
@r0b1n
r0b1n merged commit bb09f79 into main Jul 23, 2026
12 of 14 checks passed
@r0b1n
r0b1n deleted the fix/combobox-editability-inverted branch July 23, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants